fix(a11y): add aria-label to search input#220
Merged
Conversation
dkattan
added a commit
to dkattan/cardinal
that referenced
this pull request
Jun 25, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The search input had no accessible name, making it invisible to
assistive technologies. Added aria-label with i18n key
'search.aria.searchInput' ('Search input') threaded through
App → SearchBar. Updated all 15 locale files.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
27c9a8c to
2f5b56e
Compare
There was a problem hiding this comment.
Pull request overview
Adds an accessible name to the app’s primary search input by introducing an i18n-backed aria-label and threading it from App into SearchBar, with corresponding locale updates.
Changes:
- Add
ariaLabelprop toSearchBarand apply it to the query<input>asaria-label. - In
App, source the label via i18n keysearch.aria.searchInputand pass it intoSearchBar. - Add
search.aria.searchInputtranslations across all locales.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cardinal/src/App.tsx | Fetches search.aria.searchInput via t() and passes it to SearchBar. |
| cardinal/src/components/SearchBar.tsx | Adds ariaLabel prop and applies it to the search input’s aria-label. |
| cardinal/src/components/tests/SearchBar.test.tsx | Updates test helper props to include the new required ariaLabel. |
| cardinal/src/i18n/resources/en-US.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/de-DE.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/es-ES.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/fr-FR.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/it-IT.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/pt-BR.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/ru-RU.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/tr-TR.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/uk-UA.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/ar-SA.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/hi-IN.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/ja-JP.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/ko-KR.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/zh-CN.json | Adds search.aria.searchInput translation string. |
| cardinal/src/i18n/resources/zh-TW.json | Adds search.aria.searchInput translation string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
8
to
12
| const props: ComponentProps<typeof SearchBar> = { | ||
| inputRef: createRef<HTMLInputElement>(), | ||
| placeholder: 'Search', | ||
| ariaLabel: 'Search input', | ||
| value: '', |
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The search input had no accessible name, making it invisible to assistive technologies. Added
aria-labelwith i18n keysearch.aria.searchInputthreaded through App → SearchBar. Updated all 15 locale files.Split out from #219 — this is an independently mergeable accessibility fix.